package assignment

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'GET'
        url value(consumer("api/v2/onlineCodingQuizzes/submissions/\\d+/students/tasks/\\d+/assignments/\\d+/quizzes/\\d+/runningLog"),
                producer("api/v2/onlineCodingQuizzes/submissions/1/students/tasks/1/assignments/1/quizzes/1/runningLog"))
        headers {
            contentType(applicationJsonUtf8())
            header('id', 1)
        }
    }
    response {
        status(200)
        headers {
            contentType(applicationJsonUtf8())
        }
        body("""
            {
                "status":2,
                "logs":"logs"
            }
        """)
        bodyMatchers {
            jsonPath('$.status', byRegex(number()))
            jsonPath('$.logs', byRegex("[\\s\\S]+"))
        }
    }
}